package br.com.binding.client.bind.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import br.com.binding.client.bind.annotations.values.WhenAction;

/**
 * This annotation represents an Action. Actions are methods that introduce 
 * changes. Usually changes on the model. 
 * @author Marcelo Emanoel
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Action {
	/**
	 * <i>Optional</i> tells the name of the method that is the event chain of 
	 * this action, if set.
	 * @return
	 */
	String method() default "";
	
	/**
	 * <i>Optional</i> tells when should the method annotated should be called.
	 * Defaults to WhenAction.AFTER.
	 * @return
	 */
	WhenAction when() default WhenAction.AFTER;
}
